package com.weibo4j.api.req.trend;

import java.io.UnsupportedEncodingException;
import java.net.URLEncoder;

import com.weibo4j.api.WeiboRequest;
import com.weibo4j.api.annotation.Param;
import com.weibo4j.api.response.trend.TrendIsFollowResponse;
import com.weibo4j.api.util.RequestType;

public class TrendIsFollowRequest extends WeiboRequest<TrendIsFollowResponse>{

    @Param("trend_name")
    private String trendName;

    public String getTrendName() {
        if (trendName != null) {
            try {
                return URLEncoder.encode(trendName, "utf-8");
            } catch (UnsupportedEncodingException e) {
            }
        }
        return trendName;
    }

    public void setTrendName(String trendName) {
        this.trendName = trendName;
    }

    @Override
    public RequestType requestType() {
        return RequestType.GET;
    }

    @Override
    public String baseUrl() {
        return "https://api.weibo.com/2/trends/is_follow.json";
    }

    @Override
    protected Class<TrendIsFollowResponse> responseType() {
        return TrendIsFollowResponse.class;
    }


}
